<# # It is recommended to test the script on a local machine for its purpose and effects. # ManageEngine Endpoint Central will not be responsible for any # damage/loss to the data/setup based on the behavior of the script. # Description: Script is designed to change the DHCP settings to IPv4 and IPv6 for all network connections. # Configuration Type - COMPUTER #> # Get all network adapters that are not disconnected $adapters = Get-NetAdapter | Where-Object { $_.Status -eq 'Up' } # Loop through each adapter and set it to DHCP foreach ($adapter in $adapters) { # Set the adapter's IPv4 and IPv6 settings to DHCP Set-NetIPInterface -InterfaceAlias $adapter.Name -Dhcp Enabled Write-Host "Set $($adapter.Name) to use DHCP." } # Set the adapter's IP address configuration to DHCP Get-NetAdapter | ForEach-Object { $adapterName = $_.Name Set-NetIPInterface -InterfaceAlias $adapterName -Dhcp Enabled Write-Host "Configured $adapterName for DHCP." }